/**
 * @properties={typeid:35,uuid:"0191FF54-30D8-42CB-B3AC-78916B8CB1EE",variableType:4}
 */
var aux_fletero = null;

/**
 * @properties={typeid:35,uuid:"E3884FC4-FF41-45D1-B581-1987F7184C60",variableType:4}
 */
var aux_proveedor = 0;

/**
 * Handle changed data.
 *
 * @param {Object} oldValue old value
 * @param {Object} newValue new value
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"803DA08F-0FEB-4062-B73F-C39244F35F4E"}
 */
function buscar_pendientes(oldValue, newValue, event) {
	var modofind = foundset.find()
	if (modofind == false)
	{
		globals.gMensaje = 'Error - no puede hacer la búsqueda'
	   	globals.gMensajes();
	   	return true
	}
	if (aux_proveedor != null)
		{
		prov_rel_ord_servicio_id=aux_proveedor
		}
	if (aux_fletero != null)
		{
		fletero_id=aux_fletero
		}
	estado=1
	importe=0
	var found = foundset.search()
	if (found <= 0)
	{
		globals.gMensaje = 'No hay órdenes de servicio a valorizar '
	   	globals.gMensajes();
	}
	return true
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"E4930D8F-BA30-4535-B782-C90A8AC89BA3"}
 */
function onShow(firstShow, event) {
	// hace un find que debe resultar en founset vacío para que no muestre nada al comenzar
	databaseManager.setAutoSave(true)
	var modofind = foundset.find()
	if (modofind == false)
	{
		globals.gMensaje = 'Error en búsqueda al iniciar Form'
	   	globals.gMensajes();
		return true
	}
	prov_rel_ord_servicio_id=null
	estado=99
	importe=0
	var found = foundset.search()
	aux_proveedor=null
	aux_fletero=null
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"9178A188-DCD8-4AD2-AECE-2D39AC7DBB7C"}
 */
function ira_valoriza_2(event) {
	application.showFormInDialog(forms.ordenes_de_servicio_valor_2,200,200,700,600,'Valorizar Orden de Servicio',true,false,'ord_serv_valor2',true)
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"1334FDD7-7D44-4022-A52B-79EBE76C1BBE"}
 */
function anula_proveedor(event) {
	aux_proveedor=null
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"A837EEA8-061F-47D4-BAC6-3C0E4142A2FF"}
 */
function anula_fletero(event) {
	aux_fletero=null
}
